#include "SerialPort.h"
#include <iostream>
u_int8_t read_buff[512];
u_int8_t write_buff[] = "12345678";
const char *dev  = "/dev/ttyUSB0";
int main()
{ serialPort myserial;
    cout<<"serialPort Test"<<endl;
    myserial.OpenPort(dev);
    myserial.setup(19200,0,8,1,'N');
    myserial.writeBuffer(write_buff, 8);
    cout << "向串口写入了：" << write_buff << endl;
    myserial.readBuffer(read_buff, 8);
    cout<< "串口收到了： ";
    for(int i=0;i<8;i++)
    {
        cout << read_buff[i];
    }
    cout <<endl;
    return 0;
}